﻿<UserControl x:Class="myCollections.UserControls.UcAppsInfo"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Loaded="UserControl_Loaded">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="105"/>
            <ColumnDefinition/>
            <ColumnDefinition/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition />
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
            <RowDefinition />
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <TextBlock Text="{DynamicResource lblTitle}" Grid.Row="0" Grid.Column="0" Margin="0,5,0,5"/>
        <TextBox Name="TxtTitle" Grid.Row="0" Grid.Column="1" Style="{DynamicResource requiredFieldValidationStyle}" Height="24"
                     Grid.ColumnSpan="3" Margin="0,3" TextChanged="txtTitle_TextChanged" Text="{Binding Path=Title}" />

        <TextBlock Text="{DynamicResource lblBarcode}" Grid.Row="1" Grid.Column="0" Margin="0,5,0,5" ToolTip="{DynamicResource lblBarcode}"/>
        <StackPanel Grid.Row="1" Grid.Column="1"  Orientation="Horizontal">
            <TextBox Name="TxtBarcode" Margin="0,3" Text="{Binding Path=BarCode}" Height="24" Width="115"
                 Style="{DynamicResource requiredFieldValidationStyle}" TextChanged="txtTitle_TextChanged" />
            <Button ToolTip="{DynamicResource ScanBarCode}" Padding="0,0,0,0" Margin="0" Height="25" Width="25" Click="ScanButton_OnClick" 
                    Style="{DynamicResource ButtonStyle}" VerticalAlignment="Center">
                <Image Source="..\..\Images\BardcodeScanner.png"  />
            </Button>
        </StackPanel>

        <TextBlock Text="{DynamicResource NumId}" Grid.Row="1" Grid.Column="2" Margin="5" ToolTip="{DynamicResource NumIdToolTip}"/>
        <TextBox Grid.Row="1" Grid.Column="3" Margin="0,3" Text="{Binding Path=NumId}"/>

        <TextBlock Text="{DynamicResource PublicRating}" Grid.Row="2" Grid.Column="0" Margin="0,5,0,5" />
        <TextBox Grid.Row="2" Grid.Column="1" Margin="0,3" Text="{Binding Path=PublicRating}" />

        <TextBlock Text="{DynamicResource MyRating}" Grid.Row="2" Grid.Column="2" Margin="5"/>
        <ComboBox Name="cboRating" Grid.Row="2" Grid.Column="3" Margin="0,3"/>

        <TextBlock Text="{DynamicResource lblEditor}" Grid.Row="3" Grid.Column="0" Margin="0,5,0,5"/>
        <ComboBox Name="CboEditor" Grid.Row="3" Grid.Column="1" Margin="0,3" IsEditable="True" 
                  ItemsSource="{Binding}" DisplayMemberPath="Name"/>

        <TextBlock Text="{DynamicResource appsVersion}" Grid.Row="3" Grid.Column="2" Margin="5"/>
        <TextBox Grid.Row="3" Grid.Column="3" Margin="0,3" Text="{Binding Path=Version}" />

        <TextBlock Text="{DynamicResource lblDescription}" Grid.Row="4" Grid.Column="0" VerticalAlignment="Center" Margin="0,5,0,5"/>
        <TextBox Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="3" Margin="0,5" VerticalContentAlignment="Top" Height="72"
                 TextWrapping="Wrap" VerticalScrollBarVisibility="Auto" MaxLines="4"
                 AcceptsReturn="True" Text="{Binding Path=Description}"/>

        <TextBlock Text="{DynamicResource lblLanguage}" Grid.Row="5" Grid.Column="0" Margin="0,5,0,5"/>
        <ComboBox Name="CboLanguage" Grid.Row="5" Grid.Column="1" Margin="0,3" IsEditable="True" 
                   DisplayMemberPath="DisplayName" SelectedValuePath="Id"/>

        <TextBlock Text="{DynamicResource lblDateReleased}" Grid.Row="5" Grid.Column="2" Margin="5" ToolTip="{DynamicResource lblDateReleased}"/>
        <TextBox Grid.Row="5" Grid.Column="3" Margin="0,3" Text="{Binding Path=ReleaseDate,StringFormat={}{0:d}}"/>

        <TextBlock Text="{DynamicResource lblMedia}" Grid.Row="6" Grid.Column="0" Margin="0,5,0,5"/>
        <ComboBox Name="CboMedia" Grid.Row="6" Grid.Column="1" Margin="0,3"/>

        <TextBlock Text="{DynamicResource lblDateAdded}" Grid.Row="6" Grid.Column="2" Margin="5"/>
        <TextBox Grid.Row="6" Grid.Column="3" Margin="0,3" Text="{Binding Path=AddedDate,StringFormat={}{0:d}}"/>

        <TextBlock Text="{DynamicResource lblComments}" Grid.Row="7" Grid.Column="0" Margin="0,5,0,5"/>
        <TextBox Grid.Row="7" Grid.Column="1" Grid.ColumnSpan="3" Margin="0,5" Height="72"
                   VerticalContentAlignment="Top" TextWrapping="Wrap" TextAlignment="Left" VerticalScrollBarVisibility="Auto" MaxLines="4"
                    AcceptsReturn="True" AcceptsTab="True" AutoWordSelection="True" Text="{Binding Path=Comments}" />

        <TextBlock Text="{DynamicResource lblFileName}" Grid.Row="8" Grid.Column="0" Margin="0,5,0,5" ToolTip="{DynamicResource lblFileName}"/>
        <StackPanel Orientation="Horizontal" Grid.Row="8" Grid.Column="1" Grid.ColumnSpan="3" >
            <TextBox Name="TxtFileName" Margin="0,3" Width="355" Text="{Binding Path=FileName}"/>
            <Button Name="CmdBrowseFile" Width="30" Height="25" Content="..." Margin="0" Padding="0" Click="cmdBrowseFile_Click"/>
            <Button ToolTip="{DynamicResource tltRename}" Padding="0,0,0,0" Margin="0" Height="25" Width="25" Click="cmdRename_Click" Style="{DynamicResource ButtonStyle}" 
                    VerticalAlignment="Center">
                <Image Source="..\..\Images\rename.png"  />
            </Button>
        </StackPanel>

        <TextBlock Text="{DynamicResource lblFilePath}" Grid.Row="9" Grid.Column="0" Margin="0,5,0,5" ToolTip="{DynamicResource lblFilePath}"/>
        <StackPanel Orientation="Horizontal" Grid.Row="9" Grid.Column="1" Grid.ColumnSpan="3">
            <TextBox Name="TxtFilePath" Margin="0,3" Width="385" Text="{Binding Path=FilePath}"/>
            <Button Name="CmdBrowseFolder"  Width="30" Height="25" Content="..." Margin="0,3" Padding="0,0,0,0" Click="cmdBrowseFolder_Click"/>
        </StackPanel>

        <TextBlock Text="{DynamicResource lblLinks}" Grid.Row="10"  Grid.Column="0" Margin="0,5,0,5"/>
        <ListBox Name="LstLinks"  Grid.Row="10" Grid.Column="1" Grid.ColumnSpan="3" Margin="0,3"  Height="72"
                 MouseDoubleClick="lstLinks_MouseDoubleClick"  AlternationCount="1" KeyUp="lstLinks_KeyUp"
                  ToolTip="Double-Click the link to open the web page">
            <ListBox.ContextMenu>
                <ContextMenu Background="{DynamicResource ToolbarBackGroundColor}">
                    <ContextMenu.Effect>
                        <DropShadowEffect/>
                    </ContextMenu.Effect>
                    <MenuItem Header="{DynamicResource lblLinksDelete}" Name="MniDeleteAllLinks" Click="mniDeleteAllLinks_Click"/>
                    <MenuItem Header="{DynamicResource lblLinksAdd}" Name="MniAddLinks" Click="mniAddLinks_Click"/>
                </ContextMenu>
            </ListBox.ContextMenu>
        </ListBox>

        <ScrollViewer VerticalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Auto" Grid.Row="11" Grid.ColumnSpan="4" Grid.Column="0" >
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">

                <TextBlock Text="{DynamicResource lblTested}" Margin="0,3,5,7"/>
                <CheckBox Margin="0,3" IsChecked="{Binding Path=Watched}"/>

                <TextBlock Text="{DynamicResource lblToTest}" Margin="20,3,5,7" />
                <CheckBox Margin="0,3" IsChecked="{Binding Path=ToWatch}" />

                <TextBlock Text="{DynamicResource lblComplete}" Margin="20,3,5,7" />
                <CheckBox Margin="0,3" IsChecked="{Binding Path=IsComplete}" />

                <TextBlock Text="{DynamicResource lblWish}" Margin="20,3,5,7" />
                <CheckBox Margin="0,3" IsChecked="{Binding Path=IsWhish}" />

                <TextBlock Text="{DynamicResource lblToBeDeleted}" Margin="20,3,5,7" />
                <CheckBox Margin="0,3" IsChecked="{Binding Path=ToBeDeleted}" />

            </StackPanel>
        </ScrollViewer>
    </Grid>
</UserControl>

